package org.example.sunrise.sprites;

import java.util.Random;

public class PeashooterBullet extends Sprite {
    public PeashooterBullet() {
        super("bullet/Peashooter_pea.png", 20, 20);
        setPositionX(new Random().nextInt(770));
        setVelocityX(100);
    }

    @Override
    public void update() {
        if (getPositionX() > 800) {
            setNeedDestroy(true);
        }
        setPositionX(getPositionX() + getVelocityX() / 60);
        setPositionY(getPositionY() + getVelocityY() / 60);
    }
}
